

var ClickCounter = function(){
    
    if ( ClickCounter.caller != ClickCounter.getInstance ) {  
        throw new Error("This object cannot be instanciated");  
    }
    
    var _numClick = 0;
    
    this.incrementClick = function(){
        _numClick++;
    }
    
    this.getClickCount = function(){
        return _numClick;
    }
    
}

ClickCounter.sharedInstance = null;
ClickCounter.getInstance = function(){
    if(this.sharedInstance == null){
        this.sharedInstance = new ClickCounter();
    }
    return this.sharedInstance;
}